package online.chenke.designpattern.builder;

public class User {
    private String username;
    private String password;
    private String gender;
    private String birthday;

    public static Builder builder(){
        return new Builder();
    }

    public static class Builder{
        private User user = null;

        Builder(){
            user = new User();
        }

        public Builder setUsername(String username){
            user.setUsername(username);
            return this;
        }

        public Builder setPassword(String password){
            user.setPassword(password);
            return this;
        }


        public User build(){
            return user;
        }
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }
}
